package com.xxkfz.result;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @program: xxkfz-admin-redisson
 * @ClassName Result.java
 * @author: wust
 * @create: 2024-04-11 16:49
 * @description:
 **/
@ToString
@Setter
@Getter
public class Result <T>{
    private Integer code;
    private String msg;
    private T data;

    public static Result success(String msg){
        Result<Object> result = new Result<>();
        result.setCode(200);
        result.setMsg(msg);
        return  result;
    }
    public static Result success(String msg, Object data){
        Result<Object> result = new Result<>();
        result.setCode(200);
        result.setMsg(msg);
        result.setData(data);
        return  result;
    }
}